import React, { useState } from 'react'

export default function About() {
    // 第一个是当前的值
    // 修改当前数据的方法
    const [num, setNum] = useState(1000)
    const [userInfo, setUserInfo] = useState({
        name: "张三",
        age: 18
    })

    
    const [count, setCount] = useState(100)
    return (
        <div>
            About --- {count}
            <div>
                <button onClick={() => {
                    setCount(count + 1)
                }}>点我</button>
            </div>

            {/* About --- { num }
            <div>
                <button onClick={() => {
                    setNum(99999)
                }}>点我</button>
            </div> */}

            {/* <p>
                姓名: { userInfo.name }
            </p>
            <p>
                年龄: { userInfo.age }
            </p>
            <div>
                <button onClick={() => {
                    const userObj = { ...userInfo }
                    userObj.name = "王五"
                    setUserInfo(userObj)
                }}>修改姓名</button>
            </div> */}
        </div>
    )
}
